package com.wenguo.bussines.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wenguo.bussines.dao.GroupDao;
import com.wenguo.bussines.model.Group;
import com.wenguo.bussines.service.GroupService;

@Service
public class GroupServiceImpl implements GroupService {

	@Autowired private GroupDao groupDao;
	
	@Override
	public boolean deleteGroup(Integer id) {
		return groupDao.delete(id);
	}

	@Override
	public List<Group> findAllGroup() {
		return groupDao.getAll();
	}

	@Override
	public List<Group> findGroupByDefined(Map<Object, Object> map) {
		return groupDao.getByDefined(map);
	}

	@Override
	public List<Group> findGroupByEntity(Group group) {
		return groupDao.getByEntity(group);
	}

	@Override
	public Group findGroupById(Integer id) {
		return groupDao.get(id);
	}

	@Override
	public List<Group> findGroupByMap(Map<Object, Object> map) {
		return groupDao.getByMap(map);
	}

	@Override
	public boolean insertGroup(Group group) {
		return groupDao.save(group);
	}

	@Override
	public boolean updateGroup(Group group) {
		return groupDao.update(group);
	}

}
